/*
 * ProgressDialog.java
 * classes : com.ruint.core.view.dialog.ProgressDialog
 * @author ruint
 * V 1.0.0
 * Create at 2014-11-27 上午11:33:12
 */
package com.ruint.core.view.dialog;

import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.view.Gravity;
import android.view.Window;
import android.view.WindowManager;

import com.ruint.corelib.R;

/**
 * com.ruint.core.view.dialog.ProgressDialog
 * 
 * @author ruint <br/>
 *         create at 2014-11-27 上午11:33:12
 */
public class CustomProgressDialog extends Dialog {

  Context context;

  public CustomProgressDialog(Context context) {
    super(context, R.style.dialog);
    this.context = context;
  }

  public CustomProgressDialog(Context context, boolean cancelable, OnCancelListener cancelListener) {
    super(context, cancelable, cancelListener);
    this.context = context;
  }

  public CustomProgressDialog(Context context, int theme) {
    super(context, theme);
    this.context = context;
  }

  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.dialog_progress);
    setCancelable(true);
    setCanceledOnTouchOutside(false);
    Window window = getWindow();
    WindowManager.LayoutParams params = window.getAttributes();
    params.x = 0;
    params.y = 0;
    params.gravity = Gravity.CENTER;
    window.setAttributes(params);
  }

}
